#ifndef GAME_H
#define GAME_H

#include "../Renderer/D3D9Renderer.h"
#include "../Utility/Misc/Timer.h"
#include "../Renderer/RenderGObject.h"
#include "../Renderer/Camera.h"
#include "../EventSystem/EventSystem.h"

class Game
{
public:
	Game();
	~Game();
	Game(Game &game);

	static bool Initialize(HWND _hWnd, bool _bFullscreen, bool _bVsync, int _nScreenWidth, int _nScreenHeight);
	static void Run();
	static void Exit();

	static bool s_bRunning;
	static Timer s_Timer;

	static RenderGObject renderable;
	static Camera camera;

private:
	static void LoadLevel(const char* const _filePath);
	static void LoadKeyBindings(const char* const _filePath);
	static void CreateThreads();
	static unsigned int __stdcall UpdateThread(void* _argList);
	static unsigned int __stdcall RunServer(void* _argList);
	static unsigned int __stdcall RunClient(void* _argList);
	static void Update();
	static void Render();

	static vector<char> input;

	static HANDLE updateThread;
	static HANDLE serverThread;
	static HANDLE clientThread;

	static CRITICAL_SECTION cs;

	static void HandleEvent(Event* _event);
};

#endif